import fetch from 'utils/fetch';
// 显示科目名
export function listSubject() {
    const data = {
    };
    return fetch({
        url: '/guidance/listSubject',
        method: 'post',
        data
    });
}

// 显示年级

export function listGraduate() {
    const data = {
    };
    return fetch({
        url: '/guidance/listGraduate',
        method: 'post',
        data
    });
}

// 根据年级和科目查教材
export function getEdition(subjectId, gradesId) {
    const data = {
        subjectId,
        gradesId
    };
    return fetch({
        url: '/manage/getEdition',
        method: 'post',
        data
    });
}

// 根据教材查课本

export function getBook(editionId,subjectId, gradesId) {
    const data = {
        editionId,
        subjectId,
        gradesId
    };
    return fetch({
        url: '/manage/getBook',
        method: 'post',
        data
    });
}

// 根据课本查课程
export function getChapter(bookId) {
    const data = {
        bookId,
    };
    return fetch({
        url: '/manage/getChapter',
        method: 'post',
        data
    });
}

//资源条件分页查询
export function getResourceByPage(page, rows, subjectId, gradesId, editionId, bookId,chapterId,fileType,other) {
    const data = {
        page, 
        rows, 
        subjectId, 
        gradesId, 
        editionId, 
        bookId,
        chapterId,
        fileType,
        other
    };
    return fetch({
        url: '/manage/getResourceByPage',
        method: 'post',
        data
    });
}


//删除资源
export function removeResource(subjectId,id) {
    const data = {
        subjectId,
        id
    };
    return fetch({
        url: '/manage/removeResource',
        method: 'post',
        data
    });
}


//分页查询课件
export function getCoursewareByPage(page, rows, subjectId, gradesId, editionId, bookId,chapterId) {
    const data = {
        page, 
        rows, 
        subjectId, 
        gradesId, 
        editionId, 
        bookId,
        chapterId
    };
    return fetch({
        url: '/manage/getCoursewareByPage',
        method: 'post',
        data
    });
}


//删除课件
export function removeCourseware(subjectCode,id) {
    const data = {
        subjectCode,
        id
    };
    return fetch({
        url: '/manage/removeCourseware',
        method: 'post',
        data
    });
}


//分页查询题库
export function getQuestion(page,rows,subjectId,gradesId,editionId,bookId,chapterId,tag) {
    const data = {
        page,
        rows,
        subjectId,
        gradesId,
        editionId,
        bookId,
        chapterId,
        tag
    };
    return fetch({
        url: '/manage/getQuestion',
        method: 'post',
        data
    });
}
//查看题目信息
export function getQuestionInfo(subjectId,id) {
    const data = {
        subjectId,
        id
    };
    return fetch({
        url: '/manage/getQuestionInfo',
        method: 'post',
        data
    });
}


//删除题目
export function removeQuestion(subjectId,id) {
    const data = {
        subjectId,
        id
    };
    return fetch({
        url: '/manage/removeQuestion',
        method: 'post',
        data
    });
}